<ul>
    <#list iteamShops as item>
    <li class="_j_goods_li">
        <div class="info">
                <img src="${item.pictureurl}"
                     alt="道具图片">
                <div class="name" style="color: #12093f">${item.name}<span style="color: #0f043f">剩余${item.num}</span></div>
        </div>
        <div class="buy">
            <span><i class="icon_gold"></i>${item.price}</span>
            <a class="btn_buy" data-id="${item.id}">购买</a>
        </div>
    </li>
    </#list>
</ul>
     <script>
         $(function () {
             $('.btn_buy').click(function () {
                 alert("你确定购买吗");
                 var id = $(this).data("id");
                 $.get("/itemshop/buy",{id:id},function (data) {
                     if (data.success){
                         alert(data.data);
                         window.location.reload();
                     }else {
                         alert(data.msg);
                     }
                 })
             });
         })
     </script>